package com.ftg.learn.chapter09.io;

import lombok.SneakyThrows;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * 复制
 *
 *
 * @author lijiaxin
 * @version 1.0
 * @date 2023/8/21 15:43
 */

public class Cv {
    @SneakyThrows
    public static void main(String[] args) {

        File f1=new File("D:\\李嘉欣\\111.jpg");
        File f2=new File("D:\\李嘉欣\\222.jpg");

        if(!f2.exists()){
            f2.createNewFile();
        }

        FileInputStream fis=new FileInputStream(f1);
        FileOutputStream fos=new FileOutputStream(f2);

        int n=0;
        while ((n= fis.read())!=-1){
            fos.write(n);
        }
    }
}
